<template>
    <div id="scratch" class="scratch-card">
        <div id="card">{{luckyMoney}}</div>
    </div>
</template>
<style lang="less" scoped>
    #card {
        height: 100%;
        font-weight: bold;
        font-size: 40px;
        line-height: 100px;
        text-align: center;
        background: #FAFAFA;
        user-select:none;
    }

    #scratch {
        position: relative;
        width: 300px;
        height: 100px;
        margin: 50px auto 0;
        border: 1px solid #ccc;
    }
</style>
<style lang="less">
    .scratch-card #cover{
        position: absolute;
        top:0;
        left:0;
    }
</style>
<script>
    import LuckyCard from 'static/luckyCard/lucky-card';
    export default{
        props: {
            luckyMoney: {
                type: String,
                default: '￥5000000元'
            }
        },
        data(){
            return{

            }
        },
        components:{

        },
        computed:{

        },
        methods:{
            handleBack() {
                this.$emit("handleSuccessCard",this.luckyMoney)
            }
        },
        created(){

        },
        mounted(){
            const self = this;
            LuckyCard.case({
                ratio: .5
            }, function() {
                self.handleBack();
                this.clearCover();
            });
        }
    }
</script>
